
export const getdate = (date) => {
    console.log(date);
    //年
var year = date.getFullYear();
//月
var month = date.getMonth() + 1;
//日
var strDate = date.getDate();
//时
var hour = date.getHours();
//分
var minute = date.getMinutes();
//秒
var second = date.getSeconds();
 
month = month > 9 ? month : '0' + month
 
strDate = strDate > 9 ? strDate : '0' + strDate
 
hour = hour > 9 ? hour : '0' + hour
 
minute = minute > 9 ? minute : '0' + minute
 
second = second > 9 ? second : '0' + second
//  ' ' + hour + ':' + minute + ':' + second
return year + '-' + month + '-' + strDate
}